(function () {
    const userAgent = navigator.userAgent.toLowerCase()
    if (userAgent.includes('mobile')) {
        if (!location.pathname.includes('/m')) {
            location.replace('/m')
        }
    } else {
        if (location.pathname.includes('/m')) {
            location.replace('/')
        }
    }
})()